import realClass.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Author quan
 * @Description 验证App中的三种方法拿到的对象是不是同一个？
 * @Date 2023/7/12 17:32
 */

public class a02_ValideThreeWays {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
        User user1 = (User) context.getBean("user");
        System.out.println("方式1："+user1);
        User user2 = context.getBean(User.class);
        System.out.println("方式2："+user2);
//        User user3 = context.getBean("user",User.class);
//        System.out.println("方式3："+user3);
    }
}
